using System;
using System.Collections.Generic;
using System.Text;

using NHibernate;
using NHibernate.Data.Models;
using NHibernate.Data.Base;

namespace NHibernate.Data.Managers
{
    public partial interface IBrandManager : IManagerBase<Brand, long>
    {
		// Get Methods
		IList<Brand> GetByLocalName(System.Int64 localName);
		IList<Brand> GetByWinery(System.Int64 winery);
    }

    partial class BrandManager : ManagerBase<Brand, long>, IBrandManager
    {
		#region Constructors
		
		public BrandManager() : base()
        {
        }
        public BrandManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Brand> GetByLocalName(System.Int64 localName)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Brand));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("LocalName", localName));
			
			return criteria.List<Brand>();
        }
		
		public IList<Brand> GetByWinery(System.Int64 winery)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Brand));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Winery", winery));
			
			return criteria.List<Brand>();
        }
		
		#endregion
    }
}